<?php
namespace app\api\validate;

use think\Validate;

class CourseValidate extends Validate
{
    protected $rule = [
        'course_id' => 'require',
        'recipients' => 'require|chsDash',
        'mobile'  => 'require|mobile',
        'province' => 'require|chsDash',
        'city' => 'require|chsDash',
        'district' => 'chsDash',
        'site' => 'require|chsDash',
    ];
    protected $message = [
        'course_id.require' => '课程ID为空，非法操作',
        'recipients.require'  => '请输入收货人名称',
        'recipients.chsDash'  => '请输入正确的收货人名称【名字只能为：汉字、字母、数字和下划线】',
        
        'mobile.require'  => '请输入手机号',
        'mobile.mobile'  => '请输入正确的手机号',


        'province.require'  => '请选择收货省份',
        'province.chsDash'  => '请输入正确的收货省份',


        'city.require'  => '请选择收货市',
        'city.chsDash'  => '请输入正确的收货市',

        //'district.require'  => '请选择收货区/县',
        'district.chsDash'  => '请输入正确的收货区/县',

        'site.require'  => '请输入收货详细地址',
        'site.chsDash'  => '请输入正确的收货详细地址【只能输入：汉字、字母、数字和下划线】',
       
    ];

    protected $scene = [
        'pay'  => ['course_id', 'recipients', 'mobile', 'province', 'city', 'district', 'site'],
    ];
}